package routers

import (
	"github.com/gin-gonic/gin"
	"learning/gooop/saga/mqs/handlers"
	"learning/gooop/saga/order"
	"learning/gooop/saga/stock"
)

func RegisterRouters() *gin.Engine {
	r := gin.Default()
	r.Use(gin.Logger())

	r.GET("/ping", handlers.Ping)
	r.POST("/subscribe", handlers.Subscribe)
	r.POST("/publish", handlers.Publish)
	r.POST("/notify", handlers.Notify)

	r.POST(order.PathOfNotifyStockOutbound, order.NotifyStockOutbound)
	r.POST(stock.PathOfNotifySaleOrderCreated, stock.NotifySaleOrderCreated)

	return r
}